function showToast(title){
  wx.showToast({
    title: title,
    duration: 2000
  })
}
function showLoading(title){
  wx.showLoading({
    title: title ,
  })
}
function showModal(title, content, showCancel){
  return new Promise(function (resolve, reject) {
    wx.showModal({
      title: title,
      content: content,
      showCancel: showCancel,
      success: function (res) {
        if (res.confirm) {
          resolve(true)
          console.log('用户点击确定')
        } else if (res.cancel) {
          resolve(false)
          console.log('用户点击取消')
        }
      }
    })
  })
}
function showTi(content) {
  wx.showModal({
    title: '提示',
    content: content,
    showCancel: false,
    success: function (res) {
      if (res.confirm) {
        console.log("点击了")
      }
    }
  })
}
module.exports = {
  showToast: showToast,
  showLoading: showLoading,
  showModal: showModal,
  showTi: showTi
}